import {
  api
} from '../../libs/api'
import {
  mapState,
  mapActions
} from "vuex";

export function getSystemTime(ctx) {
  api.onRequest('$method.$get.sys.datetime', null, null, null, function (msg, reply) {
    var res = JSON.parse(msg)
    if (res && res.code == 0 && res.data && res.data.datetime) {
      ctx.$store.dispatch("system/getSystemTime", res.data.datetime);
    } else {
      ctx.$store.dispatch("system/getSystemTime", '');
    }
  })
}

